import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        CardGame game = new CardGame();
        List<Card> cards = game.buyCard();
        System.out.println(cards);
        game.shuffle(cards);
        System.out.println("洗牌后:"+cards);


        //3个人每个人进行摸排
        List<Card> hands1=new ArrayList<>();
        List<Card> hands2=new ArrayList<>();
        List<Card> hands3=new ArrayList<>();
        List<List<Card>> hands=new ArrayList<>();
        hands.add(hands1);
        hands.add(hands2);
        hands.add(hands3);

        for(int i=0;i<5;i++){
            for(int j=0;j<3;j++){
                Card card=cards.removeFirst();//每次取第一个元素
                hands.get(j).add(card);
            }
        }
        System.out.println("第一个人的牌:"+hands1);
        System.out.println("第二个人的牌:"+hands2);
        System.out.println("第三个人的牌:"+hands3);
        System.out.println("剩余的牌:"+cards);
    }
}
